package pixelwaks.gui.impl;

import java.awt.BorderLayout;
import java.awt.Color;

import javax.swing.JPanel;

import pixelwaks.core.impl.Game;
import pixelwaks.core.impl.Player;

/**
 * Class for creating a base panel, which holds a PlayerInfoPanel for each Player. 
 * Only works for one or two players.
 * @author Joakim
 *
 */
@SuppressWarnings("serial")
public class BasePanel extends JPanel  {
	
	/**
	 * Creates a base panel and adds a PlayerInfoPanel for each Player (one or two).
	 */
	public BasePanel() {
		setLayout(new BorderLayout());
		setBackground(Color.WHITE);
		setVisible(true);
		
		int i = 0;
		for(Player player : Game.getInstance().getPlayers()) {
			if(i == 0)
				add(new PlayerInfoPanel(player), BorderLayout.WEST);
			else if(i == 1)
				add(new PlayerInfoPanel(player), BorderLayout.EAST);
			i++;
		}
		add(new ModeInfo(), BorderLayout.CENTER);
	}
}
